﻿<UserControl x:Class="eventr.View.ImageOverlay"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="402" d:DesignHeight="240" 
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"             
             >
    <Grid x:Name="LayoutRoot" Background="{x:Null}" IsHitTestVisible="False">
        <vsm:VisualStateManager.VisualStateGroups>
            <vsm:VisualStateGroup x:Name="Mode">
                <vsm:VisualState x:Name="Invisible">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="VideoOverlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:02">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="VideoOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="Visible">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="VideoOverlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="VideoOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                            <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
            </vsm:VisualStateGroup>
            
            <vsm:VisualStateGroup x:Name="Stats">
                <vsm:VisualState x:Name="StatsOff">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ViewedOverlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:01">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ViewedOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>

                </vsm:VisualState>
                <vsm:VisualState x:Name="StatsOn">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ViewedOverlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ViewedOverlay" Storyboard.TargetProperty="(UIElement.Opacity)">
                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                            <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>


                </vsm:VisualState>
            </vsm:VisualStateGroup>
            
            
        </vsm:VisualStateManager.VisualStateGroups>
        <Grid x:Name="ViewedOverlay" Visibility="Collapsed" Opacity="0">
            <Border Height="50" HorizontalAlignment="Left" VerticalAlignment="Top" Width="50" Background="#CC000000">
                <TextBlock Text="{Binding Path=Value.Count}" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FFFFFFFF" FontFamily="Georgia" FontSize="16"/>
            </Border>
            <Border Height="Auto" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="Auto" Background="#CC000000">
                <TextBlock Text="{Binding Path=Value.Title}" Height="Auto" Foreground="#FFFFFFFF"/>
            </Border>
        </Grid>
        <Grid x:Name="VideoOverlay" Visibility="Collapsed" Opacity="0" >
            <MediaElement Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" x:Name="Media" Stretch="UniformToFill" IsHitTestVisible="False" />
        </Grid>
    </Grid>
</UserControl>
